package com.xiaozhengkeji.springboot.speed.api;

import com.xiaozhengkeji.springboot.speed.bean.ResponseBean;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.LinkedHashMap;

/**
 * @RequiresPermissions 需要拥有权限
 * @RequiresAuthentication 需要登陆
 * value = {"", ""}, logical = Logical.OR
 * 1=C 2=B 3=A 4=S
 */

@Slf4j
@RestController
@ApiOperation("系统Api")
@RequestMapping("/sys")
public class SysApi {
    @ApiOperation("获取系统核心信息")
    @GetMapping("/info")
    public ResponseBean sysInfo(HttpServletRequest request) {
        HashMap<Object, Object> objectHashMap = new LinkedHashMap<>();
        objectHashMap.put("版本", "alpha-1");
        return new ResponseBean(200, "小正的SpringBoot单列快速开发框架", objectHashMap);
    }
}
